package com.hyperboost.backend.service.impl;

import java.util.List;
import com.hyperboost.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hyperboost.backend.mapper.ShareMapper;
import com.hyperboost.backend.domain.Share;
import com.hyperboost.backend.service.IShareService;

/**
 * 分享列表Service业务层处理
 * 
 * @author LXY
 * @date 2025-04-19
 */
@Service
public class ShareServiceImpl implements IShareService 
{
    @Autowired
    private ShareMapper shareMapper;

    /**
     * 查询分享列表
     * 
     * @param shareId 分享列表主键
     * @return 分享列表
     */
    @Override
    public Share selectShareByShareId(Long shareId)
    {
        return shareMapper.selectShareByShareId(shareId);
    }

    /**
     * 查询分享列表列表
     * 
     * @param share 分享列表
     * @return 分享列表
     */
    @Override
    public List<Share> selectShareList(Share share)
    {
        return shareMapper.selectShareList(share);
    }

    /**
     * 新增分享列表
     * 
     * @param share 分享列表
     * @return 结果
     */
    @Override
    public int insertShare(Share share)
    {
        share.setCreateTime(DateUtils.getNowDate());
        return shareMapper.insertShare(share);
    }

    /**
     * 修改分享列表
     * 
     * @param share 分享列表
     * @return 结果
     */
    @Override
    public int updateShare(Share share)
    {
        share.setUpdateTime(DateUtils.getNowDate());
        return shareMapper.updateShare(share);
    }

    /**
     * 批量删除分享列表
     * 
     * @param shareIds 需要删除的分享列表主键
     * @return 结果
     */
    @Override
    public int deleteShareByShareIds(Long[] shareIds)
    {
        return shareMapper.deleteShareByShareIds(shareIds);
    }

    /**
     * 删除分享列表信息
     * 
     * @param shareId 分享列表主键
     * @return 结果
     */
    @Override
    public int deleteShareByShareId(Long shareId)
    {
        return shareMapper.deleteShareByShareId(shareId);
    }
}
